package cn.fl.inscare.transform;

import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.inscare.vo.InsPolicyDetailVO;
import ins.car.facade.car.car.dto.InsPolicyDetailDTO;
import java.util.ArrayList;
import java.util.List;


/**
* @Description: 保单中保险详情表，类型，金额，起保日期，截止日期 转换器
* @Description: VO是客户端传递数据到服务端进行转换的数据
* @Description: VO转换数据变成DTO传递到服务端
* @Description: VO不能在服务端出现
*/
public class InsPolicyDetailVOTransform extends InsBaseInsPolicyDetailVOTransform{


   /**
    * DTO 转  VO
    * @param po InsPolicyDetailDTO
    * @return InsPolicyDetailVO
    */
   public static InsPolicyDetailVO toVO(InsPolicyDetailDTO dto) {
       InsPolicyDetailVO  vo = baseToVO(dto);
       //设置自定义扩展属性
       return vo;
   }

   /**
    * VO 转 DTO
    * @param dto InsPolicyDetailVO
    * @return InsPolicyDetailDTO
    */
   public static InsPolicyDetailDTO toDTO(InsPolicyDetailVO vo) {
       InsPolicyDetailDTO dto = baseToDTO(vo);
       //设置自定义扩展属性
       return dto;
   }

   /**
    * DTO集合 转 VO集合
    * @param List<InsPolicyDetailDTO>
    * @return List<InsPolicyDetailVO>
    */
   public static List<InsPolicyDetailVO> toVOList(List<InsPolicyDetailDTO> list) {
       List<InsPolicyDetailVO>  voList = new ArrayList<InsPolicyDetailVO>();
       if(CollectionUtils.isNotEmpty(list)){
           for (InsPolicyDetailDTO dto : list) {
               voList.add(toVO(dto));
           }
       }
       return voList;
   }

   /**
    * VO集合 转 DTO集合
    * @param list List<InsPolicyDetailVO>
    * @return List<InsPolicyDetailDTO>
    */
   public static List<InsPolicyDetailDTO> toDTOList(List<InsPolicyDetailVO> list) {
       List<InsPolicyDetailDTO>  dtoList = new ArrayList<InsPolicyDetailDTO>();
       if(CollectionUtils.isNotEmpty(list)){
           for (InsPolicyDetailVO vo : list) {
               dtoList.add(toDTO(vo));
           }
       }
       return dtoList;
   }
}
